{layout name="index/layout" /}        <!--content-->
<div class="log">
    <div class="clear"></div>
    <div class="query">
        <h5>站内消息</h5>
        <div>
            <div>
                <form action="msg.html" method="get">
                    <div>
                        <input type="hidden" name="status" value="1">
                        <input id="{if $status eq 1}read{/if}" class="button msg" type="submit" value="未读消息">
                    </div>
                </form>
            </div>
            <div>
                <form action="msg.html" method="get">
                    <div>
                        <input type="hidden" name="status" value="0">
                        <input id="{if $status eq 0}read{/if}" class="button msg" type="submit" value="已读消息">
                    </div>
                </form>
            </div>
        </div>
        <div class="table">
            <table>
                <tr>
                    <th>发送人</th>
                    <th>标题</th>
                    <th>内容预览</th>
                    <th>发送时间</th>
                    <th>操作</th>
                </tr>
                {if $messages neq false}
                {foreach $messages as $msg}
                <tr class="table_query">
                    <td>{$msg.admin_id}</td>
                    <td>{$msg.title}</td>
                    <td>{$msg.content|substr=0,30}
                        <button style="float: right;height: 28px;">点击展开</button>
                    </td>
                    <td>{$msg.sendtime|date='Y-m-d H:i:s',###}</td>
                    <td width="170px">
                        {if $status eq 1}
                        <form action="msg.html" method="post" style="display: inline">
                            <input type="hidden" name="update" value="{$msg.id}">
                            <input class="button" type="submit" value="设为已读">
                        </form>
                        {else}
                        <form action="#" style="display: inline">
                            <input type="hidden" name="update" value="{$msg.id}">
                            <input class="button" type="submit" value="待开发">
                        </form>
                        {/if}
                        <form action="msg.html" method="post" style="display: inline">
                            <input type="hidden" name="delete" value="{$msg.id}">
                            <input type="hidden" name="status" value="{$status}">
                            <input class="button" type="submit" value="删除">
                        </form>
                    </td>
                </tr>
                <tr class="productID">
                    <td colspan="6">
                        <table class="product">
                            <tr>
                                <th>详细内容</th>
                            </tr>
                            <tr class="table_query">
                                <td>{$msg.content}</td>
                            </tr>
                        </table>
                    </td>
                </tr>
                {/foreach}
                <tr>
                    {if $messages->render() eq null}
                    {else}
                <tr class="table_query">
                    <td colspan="9">{$messages->render()}</td>
                </tr>
                {/if}
                {else}
                <tr>
                    <td colspan="5" class="table_not">没有新的未读站内消息</td>
                </tr>
                {/if}
            </table>
        </div>
    </div>
</div>
<div class="clear"></div>
<script>
    var action = document.getElementById('msg');
    action.className = 'action';
</script>